package com.eshop.storm;

import com.eshop.storm.cons.ProjectCons;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: Xukai
 * @description:
 * @createDate: 2018/8/7 21:34
 * @modified By:
 */
public class Test {

    public static void main(String[] args) {

        String response = "{\"id\": " + 15 + ", \"name\": \"iphone7手机\", \"price\": 6660, \"pictureList\":\"a.jpg,b.jpg\", \"specification\": \"iphone7的规格\", \"service\": \"iphone7的售后服务\", \"color\": \"红色,白色,黑色\", \"size\": \"5.5\", \"shopId\": 1, \"modifiedTime\": \"2017-01-01 12:01:00\"}";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("productInfo", response));
        String productInfo = URLEncodedUtils.format(params, HTTP.UTF_8);
        System.out.println(ProjectCons.APP_NGINX_01_HOT_PRODUCT_BASE_URL[0] + 15 + ProjectCons.APP_NGINX_01_HOT_PRODUCT_BASE_URL[1] + productInfo);

        // TreeMap<Long, Long> treeMap = new TreeMap<>((a, b) -> (int) (b - a));
        // treeMap.put(1L, 11L);
        // treeMap.put(3L, 33L);
        // treeMap.put(2L, 22L);
        // SortedMap<Long, Long> tailMap = treeMap.tailMap(1L);
        // System.out.println(tailMap);
        // SortedMap<Long, Long> headMap = treeMap.headMap(1L);
        // System.out.println(headMap);
        // for (Map.Entry<Long, Long> entry : treeMap.entrySet()) {
        //     if (entry.getKey() > 1L) {
        //         System.out.println(entry);
        //     } else {
        //         break;
        //     }
        // }
        // ArrayList<Integer> list = new ArrayList<>();
        // System.out.println(list.contains(1));
        // for (Integer integer : list) {
        //     System.out.println(integer);
        // }
        // String taskIdList = "1,2,3";
        // List<String> list = Arrays.stream(taskIdList.split(",")).collect(Collectors.toList());
        // System.out.println(list);
    }
}
